package com.fire.market.service.impl;

import com.fire.component.dto.SingleResponse;
import com.fire.component.extension.Assert;
import com.fire.market.promo.api.dto.PromoInfo;
import com.fire.market.promo.api.service.PromoQueryFrontService;
import org.apache.dubbo.config.annotation.Service;

import javax.annotation.Resource;

/**
 * PromoQueryFrontServiceImpl
 *
 * @author zwd
 * @date 2021/7/20
 */
@Service
public class PromoQueryFrontServiceImpl implements PromoQueryFrontService {
    @Resource
    PromoQueryCoreService promoQueryCoreService;
    @Override
    public SingleResponse<PromoInfo> queryPromo(Integer itemId) {
        Assert.notNull(itemId, "itemId is null");
        return SingleResponse.of(promoQueryCoreService.queryPromoByItemId(itemId));
    }
}
